package com.java.learning.cha1;

import java.io.BufferedInputStream;
import java.io.FileInputStream;

public class BufferedInputStreamDemo {
    public static void main(String[] args) {
        BufferedInputStream bi = null;
        try {
            bi = new BufferedInputStream(new FileInputStream("D:\\mytest2.txt"));
            int result = 0;
            while ((result = bi.read()) != -1) {
                System.out.print((char)result);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                bi.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
